<?php
declare (strict_types=1);

namespace app\api\model;

use app\common\model\HelpCategory as HelpCategoryModel;

/**
 * 帮助文档分类模型
 * Class HelpCategory
 * @package app\api\model
 */
class HelpCategory extends HelpCategoryModel
{
    /**
     * 获取全部记录
     * @return \think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getAll(): \think\Collection
    {
        return $this->field('id as value, name as label')->order(['sort', $this->getPk()])
            ->select();
    }
}
